from __future__ import unicode_literals
from common.base_model import BaseModel
from django.db import models


class Server(BaseModel):
    id = models.CharField(primary_key=True, max_length=36)
    ip = models.CharField(max_length=36)
    port = models.IntegerField(blank=True, null=True)
    state = models.IntegerField(blank=True, null=True)
    pcname = models.CharField(max_length=36)
    qhname = models.CharField(max_length=36)


class Wrong(BaseModel):
    id = models.CharField(primary_key=True, max_length=36)
    date = models.DateTimeField(blank=True, null=True)
    wrongIp = models.CharField(max_length=3000)
    wrongPcname = models.CharField(max_length=1000)
    wrongQhname = models.CharField(max_length=1000)
    wrongNum = models.IntegerField(blank=True, null=True)


class Ts(BaseModel):
    id = models.CharField(primary_key=True, max_length=36)
    pcname = models.CharField(max_length=36)
    qhname = models.CharField(max_length=36)
    state = models.IntegerField(blank=True, null=True)


class OriginalInfo(BaseModel):
    id = models.CharField(primary_key=True, max_length=36)
    area = models.CharField(max_length=50)
    business = models.CharField(max_length=50, blank=True, null=True)
    link = models.CharField(max_length=50, blank=True, null=True)
    customer_order_code = models.CharField(max_length=50, blank=True, null=True)
    order_code = models.CharField(max_length=50, blank=True, null=True)
    bureaus = models.CharField(max_length=50, blank=True, null=True)
    number = models.CharField(max_length=50, blank=True, null=True)
    treatment_organization = models.CharField(max_length=50, blank=True, null=True)
    treatment_organization_id = models.IntegerField(blank=True, null=True)
    treater = models.CharField(max_length=50, blank=True, null=True)
    treater_id = models.CharField(max_length=50, blank=True, null=True)
    department = models.CharField(max_length=50, blank=True, null=True)
    end_time = models.DateTimeField(blank=True, null=True)
    mark = models.CharField(max_length=50, blank=True, null=True)
    start_time = models.DateTimeField(blank=True, null=True)
    completion_time = models.DateTimeField(blank=True, null=True)
    work_time = models.DateTimeField(blank=True, null=True)
    door_time = models.DateTimeField(blank=True, null=True)
    package = models.CharField(max_length=50, blank=True, null=True)
    product = models.CharField(max_length=50, blank=True, null=True)
    customer_level = models.CharField(max_length=50, blank=True, null=True)
    customer_quality = models.CharField(max_length=50, blank=True, null=True)
    yes_no = models.CharField(max_length=50, blank=True, null=True)
    assigner = models.CharField(max_length=50, blank=True, null=True)
    assigns_department = models.CharField(max_length=50, blank=True, null=True)
    new_ftth = models.CharField(max_length=50, blank=True, null=True)
    old_ftth = models.CharField(max_length=50, blank=True, null=True)
    new_equipment = models.CharField(max_length=50, blank=True, null=True)
    old_equipment = models.CharField(max_length=50, blank=True, null=True)
    crm_mess = models.CharField(max_length=50, blank=True, null=True)
    yes_no2 = models.CharField(max_length=50, blank=True, null=True)
    site_name = models.CharField(max_length=50, blank=True, null=True)
    position = models.CharField(max_length=50, blank=True, null=True)
    moving_type = models.CharField(max_length=50, blank=True, null=True)
    loading_time = models.DateTimeField(blank=True, null=True)
    grid_id = models.IntegerField(blank=True, null=True)
    grid_name = models.CharField(max_length=50, blank=True, null=True)
    dialing = models.CharField(max_length=50, blank=True, null=True)
    subregion = models.CharField(max_length=50, blank=True, null=True)
    equipment_type = models.CharField(max_length=50, blank=True, null=True)
    new_business_type = models.CharField(max_length=50, blank=True, null=True)
    old_business_type = models.CharField(max_length=50, blank=True, null=True)
    fuction = models.CharField(max_length=50, blank=True, null=True)
    note = models.CharField(max_length=50, blank=True, null=True)
    rate = models.CharField(max_length=50, blank=True, null=True)
    create_user = models.CharField(max_length=20, blank=True, null=True)
    update_time = models.DateTimeField(blank=True, null=True)
    update_user = models.CharField(max_length=20, blank=True, null=True)


class RecyclingInfo(BaseModel):
    id = models.CharField(primary_key=True, max_length=36)
    recycling_department = models.CharField(max_length=50)
    recycling_department_id = models.CharField(max_length=36)
    equipment = models.CharField(max_length=50, blank=True, null=True)
    business = models.CharField(max_length=50, blank=True, null=True)
    customer_order_code = models.CharField(max_length=50, blank=True, null=True)
    order_code = models.CharField(max_length=50, blank=True, null=True)
    number = models.CharField(max_length=50, blank=True, null=True)
    assigner = models.CharField(max_length=50, blank=True, null=True)
    assigns_department = models.CharField(max_length=50, blank=True, null=True)
    treatment_organization = models.CharField(max_length=50, blank=True, null=True)
    treatment_organization_id = models.IntegerField(blank=True, null=True)
    treater = models.CharField(max_length=50, blank=True, null=True)
    treater_id = models.CharField(max_length=50, blank=True, null=True)
    department = models.CharField(max_length=50, blank=True, null=True)
    end_time = models.DateTimeField(blank=True, null=True)
    crm_mess = models.CharField(max_length=500, blank=True, null=True)
    is_recycle = models.IntegerField(blank=True, null=True)
    reason = models.CharField(max_length=50, blank=True, null=True)
    state = models.IntegerField(blank=True, null=True)
    create_user = models.CharField(max_length=20, blank=True, null=True)
    update_time = models.DateTimeField(blank=True, null=True)
    update_user = models.CharField(max_length=20, blank=True, null=True)